<!--
- Author:   .
- Date:    2017/7/8 0008.
- File:    list.
-->
<template>
  <div>
    <div class="Web_Box">
      <div class="detail f24" style="padding-bottom: 0.5rem" v-for="(item, index) in shopAddressList.data">
        <div @click="selectAddress(item.address_id)">
          <div class="clear p20 f24 cr_4e4e4e">
            <span class="slhblock slh"><i class="iconfont icon-home2 cr_f23030"></i> <span class="cr_f23030 pr5">自提门店</span>  {{item.seller_name}}</span><span class="fr">{{item.telphone}}</span>
          </div>
          <div class=" slh2  hidden pl20 pr20">
            {{item.area_info}} {{item.address}}
          </div>
        </div>
      </div>
    </div>
    <empty-data :show="shopAddressList.requested && shopAddressList.data.length <= 0"></empty-data>
    <back-nav></back-nav>
  </div>
</template>

<script>
  import {mapModules, mapRules} from 'vuet'

  export default{
    mixins: [
      mapModules({shopAddressList: 'shopAddressList'}),
      mapRules({once: 'shopAddressList'})
    ],
    data() {
      return {
        from: this.$route.query.from || ''
      }
    },
    components: {},
    created() {
    },
    methods: {
      selectAddress(id) {
        if (this.from !== 'order-confirm') {  // 下单页跳进该页面时,可选择地址, 个人中心页跳进来时,点击地址无操作
          return
        }
        this.$router.replace({name: 'order-confirm', query: {cart: this.$route.query.cart, type: this.$route.query.type, shopAddressId: id}})
      }
    }
  }
</script>

<style>

</style>
